Optimal. Leaf size=115 \[ -\frac {2 a^2+b^2}{4 x^2}+\frac {b^2 \cos \left (2 \left (c+d x^2\right )\right )}{4 x^2}+a b d \cos (c) \text {Ci}\left (d x^2\right )+\frac {1}{2} b^2 d \text {Ci}\left (2 d x^2\right ) \sin (2 c)-\frac {a b \sin \left (c+d x^2\right )}{x^2}-a b d \sin (c) \text {Si}\left (d x^2\right )+\frac {1}{2} b^2 d \cos (2 c) \text {Si}\left (2 d x^2\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 115, normalized size of antiderivative = 1.00, number of steps
used = 13, number of rules used = 8, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.444, Rules used = {3484, 6, 3461,
3378, 3384, 3380, 3383, 3460} \begin {gather*} -\frac {2 a^2+b^2}{4 x^2}+a b d \cos (c) \text {CosIntegral}\left (d x^2\right )-a b d \sin (c) \text {Si}\left (d x^2\right )-\frac {a b \sin \left (c+d x^2\right )}{x^2}+\frac {1}{2} b^2 d \sin (2 c) \text {CosIntegral}\left (2 d x^2\right )+\frac {1}{2} b^2 d \cos (2 c) \text {Si}\left (2 d x^2\right )+\frac {b^2 \cos \left (2 \left (c+d x^2\right )\right )}{4 x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 6
Rule 3378
Rule 3380
Rule 3383
Rule 3384
Rule 3460
Rule 3461
Rule 3484
Rubi steps
\begin {align*} \int \frac {\left (a+b \sin \left (c+d x^2\right )\right )^2}{x^3} \, dx &=\int \left (\frac {a^2}{x^3}+\frac {b^2}{2 x^3}-\frac {b^2 \cos \left (2 c+2 d x^2\right )}{2 x^3}+\frac {2 a b \sin \left (c+d x^2\right )}{x^3}\right ) \, dx\\ &=\int \left (\frac {a^2+\frac {b^2}{2}}{x^3}-\frac {b^2 \cos \left (2 c+2 d x^2\right )}{2 x^3}+\frac {2 a b \sin \left (c+d x^2\right )}{x^3}\right ) \, dx\\ &=-\frac {2 a^2+b^2}{4 x^2}+(2 a b) \int \frac {\sin \left (c+d x^2\right )}{x^3} \, dx-\frac {1}{2} b^2 \int \frac {\cos \left (2 c+2 d x^2\right )}{x^3} \, dx\\ &=-\frac {2 a^2+b^2}{4 x^2}+(a b) \text {Subst}\left (\int \frac {\sin (c+d x)}{x^2} \, dx,x,x^2\right )-\frac {1}{4} b^2 \text {Subst}\left (\int \frac {\cos (2 c+2 d x)}{x^2} \, dx,x,x^2\right )\\ &=-\frac {2 a^2+b^2}{4 x^2}+\frac {b^2 \cos \left (2 \left (c+d x^2\right )\right )}{4 x^2}-\frac {a b \sin \left (c+d x^2\right )}{x^2}+(a b d) \text {Subst}\left (\int \frac {\cos (c+d x)}{x} \, dx,x,x^2\right )+\frac {1}{2} \left (b^2 d\right ) \text {Subst}\left (\int \frac {\sin (2 c+2 d x)}{x} \, dx,x,x^2\right )\\ &=-\frac {2 a^2+b^2}{4 x^2}+\frac {b^2 \cos \left (2 \left (c+d x^2\right )\right )}{4 x^2}-\frac {a b \sin \left (c+d x^2\right )}{x^2}+(a b d \cos (c)) \text {Subst}\left (\int \frac {\cos (d x)}{x} \, dx,x,x^2\right )+\frac {1}{2} \left (b^2 d \cos (2 c)\right ) \text {Subst}\left (\int \frac {\sin (2 d x)}{x} \, dx,x,x^2\right )-(a b d \sin (c)) \text {Subst}\left (\int \frac {\sin (d x)}{x} \, dx,x,x^2\right )+\frac {1}{2} \left (b^2 d \sin (2 c)\right ) \text {Subst}\left (\int \frac {\cos (2 d x)}{x} \, dx,x,x^2\right )\\ &=-\frac {2 a^2+b^2}{4 x^2}+\frac {b^2 \cos \left (2 \left (c+d x^2\right )\right )}{4 x^2}+a b d \cos (c) \text {Ci}\left (d x^2\right )+\frac {1}{2} b^2 d \text {Ci}\left (2 d x^2\right ) \sin (2 c)-\frac {a b \sin \left (c+d x^2\right )}{x^2}-a b d \sin (c) \text {Si}\left (d x^2\right )+\frac {1}{2} b^2 d \cos (2 c) \text {Si}\left (2 d x^2\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.15, size = 116, normalized size = 1.01 \begin {gather*} \frac {-2 a^2-b^2+b^2 \cos \left (2 \left (c+d x^2\right )\right )+4 a b d x^2 \cos (c) \text {Ci}\left (d x^2\right )+2 b^2 d x^2 \text {Ci}\left (2 d x^2\right ) \sin (2 c)-4 a b \sin \left (c+d x^2\right )-4 a b d x^2 \sin (c) \text {Si}\left (d x^2\right )+2 b^2 d x^2 \cos (2 c) \text {Si}\left (2 d x^2\right )}{4 x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 0.28, size = 203, normalized size = 1.77
method | result | size |
risch | \(-\frac {\mathrm {csgn}\left (d \,x^{2}\right ) {\mathrm e}^{-2 i c} \pi \,b^{2} d}{4}+\frac {\sinIntegral \left (2 d \,x^{2}\right ) {\mathrm e}^{-2 i c} b^{2} d}{2}-\frac {i \expIntegral \left (1, -2 i d \,x^{2}\right ) {\mathrm e}^{-2 i c} b^{2} d}{4}+\frac {i b^{2} d \expIntegral \left (1, -2 i d \,x^{2}\right ) {\mathrm e}^{2 i c}}{4}-\frac {a b d \expIntegral \left (1, -i d \,x^{2}\right ) {\mathrm e}^{i c}}{2}+\frac {i \mathrm {csgn}\left (d \,x^{2}\right ) \pi \,{\mathrm e}^{-i c} a b d}{2}-i \sinIntegral \left (d \,x^{2}\right ) {\mathrm e}^{-i c} a b d -\frac {\expIntegral \left (1, -i d \,x^{2}\right ) {\mathrm e}^{-i c} a b d}{2}-\frac {a^{2}}{2 x^{2}}-\frac {b^{2}}{4 x^{2}}-\frac {a b \sin \left (d \,x^{2}+c \right )}{x^{2}}+\frac {b^{2} \cos \left (2 d \,x^{2}+2 c \right )}{4 x^{2}}\) | \(203\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains complex when optimal does not.
time = 0.41, size = 124, normalized size = 1.08 \begin {gather*} \frac {1}{2} \, {\left ({\left (\Gamma \left (-1, i \, d x^{2}\right ) + \Gamma \left (-1, -i \, d x^{2}\right )\right )} \cos \left (c\right ) - {\left (i \, \Gamma \left (-1, i \, d x^{2}\right ) - i \, \Gamma \left (-1, -i \, d x^{2}\right )\right )} \sin \left (c\right )\right )} a b d + \frac {{\left ({\left ({\left (i \, \Gamma \left (-1, 2 i \, d x^{2}\right ) - i \, \Gamma \left (-1, -2 i \, d x^{2}\right )\right )} \cos \left (2 \, c\right ) + {\left (\Gamma \left (-1, 2 i \, d x^{2}\right ) + \Gamma \left (-1, -2 i \, d x^{2}\right )\right )} \sin \left (2 \, c\right )\right )} d x^{2} - 1\right )} b^{2}}{4 \, x^{2}} - \frac {a^{2}}{2 \, x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 147, normalized size = 1.28 \begin {gather*} \frac {2 \, b^{2} d x^{2} \cos \left (2 \, c\right ) \operatorname {Si}\left (2 \, d x^{2}\right ) - 4 \, a b d x^{2} \sin \left (c\right ) \operatorname {Si}\left (d x^{2}\right ) + 2 \, b^{2} \cos \left (d x^{2} + c\right )^{2} - 4 \, a b \sin \left (d x^{2} + c\right ) - 2 \, a^{2} - 2 \, b^{2} + 2 \, {\left (a b d x^{2} \operatorname {Ci}\left (d x^{2}\right ) + a b d x^{2} \operatorname {Ci}\left (-d x^{2}\right )\right )} \cos \left (c\right ) + {\left (b^{2} d x^{2} \operatorname {Ci}\left (2 \, d x^{2}\right ) + b^{2} d x^{2} \operatorname {Ci}\left (-2 \, d x^{2}\right )\right )} \sin \left (2 \, c\right )}{4 \, x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (a + b \sin {\left (c + d x^{2} \right )}\right )^{2}}{x^{3}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 226 vs.
\(2 (108) = 216\).
time = 3.63, size = 226, normalized size = 1.97 \begin {gather*} \frac {4 \, {\left (d x^{2} + c\right )} a b d^{2} \cos \left (c\right ) \operatorname {Ci}\left (d x^{2}\right ) - 4 \, a b c d^{2} \cos \left (c\right ) \operatorname {Ci}\left (d x^{2}\right ) + 2 \, {\left (d x^{2} + c\right )} b^{2} d^{2} \operatorname {Ci}\left (2 \, d x^{2}\right ) \sin \left (2 \, c\right ) - 2 \, b^{2} c d^{2} \operatorname {Ci}\left (2 \, d x^{2}\right ) \sin \left (2 \, c\right ) - 4 \, {\left (d x^{2} + c\right )} a b d^{2} \sin \left (c\right ) \operatorname {Si}\left (d x^{2}\right ) + 4 \, a b c d^{2} \sin \left (c\right ) \operatorname {Si}\left (d x^{2}\right ) - 2 \, {\left (d x^{2} + c\right )} b^{2} d^{2} \cos \left (2 \, c\right ) \operatorname {Si}\left (-2 \, d x^{2}\right ) + 2 \, b^{2} c d^{2} \cos \left (2 \, c\right ) \operatorname {Si}\left (-2 \, d x^{2}\right ) + b^{2} d^{2} \cos \left (2 \, d x^{2} + 2 \, c\right ) - 4 \, a b d^{2} \sin \left (d x^{2} + c\right ) - 2 \, a^{2} d^{2} - b^{2} d^{2}}{4 \, d^{2} x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (a+b\,\sin \left (d\,x^2+c\right )\right )}^2}{x^3} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________